#include "Depend.h"

#include <string.h>
#include <fan-llvm/core/Core.h>
#include "Type.h"
#include "UnsupportedErr.h"


Type* Depend_classType = NULL;
VTable* Depend_classVTable = NULL;


/**********************************************
 *
 * Methods and fields
 *
 **********************************************/


/* Bool equals(Obj? that) */
Bool Depend_equals(Obj self, NullableObj that)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Depend.equals not implemented yet"));
}


/* Int hash() */
Int Depend_hash(Obj self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Depend.hash not implemented yet"));
}


/* Str toStr() */
Str* Depend_toStr(Obj self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Depend.toStr not implemented yet"));
}


/* Depend? fromStr(Str s, Bool checked) */
Depend* Depend_fromStr_1(Str* s)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Depend.fromStr not implemented yet"));
}


/* Depend? fromStr(Str s, Bool checked) */
Depend* Depend_fromStr(Str* s, Bool checked)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Depend.fromStr not implemented yet"));
}


/* Str name() */
Str* Depend_name(Depend* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Depend.name not implemented yet"));
}


/* Int size() */
Int Depend_size(Depend* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Depend.size not implemented yet"));
}


/* Version version(Int index) */
Version* Depend_version_0(Depend* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Depend.version not implemented yet"));
}


/* Version version(Int index) */
Version* Depend_version(Depend* self, Int index)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Depend.version not implemented yet"));
}


/* Bool isPlus(Int index) */
Bool Depend_isPlus_0(Depend* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Depend.isPlus not implemented yet"));
}


/* Bool isPlus(Int index) */
Bool Depend_isPlus(Depend* self, Int index)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Depend.isPlus not implemented yet"));
}


/* Bool isRange(Int index) */
Bool Depend_isRange_0(Depend* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Depend.isRange not implemented yet"));
}


/* Bool isRange(Int index) */
Bool Depend_isRange(Depend* self, Int index)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Depend.isRange not implemented yet"));
}


/* Version endVersion(Int index) */
Version* Depend_endVersion_0(Depend* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Depend.endVersion not implemented yet"));
}


/* Version endVersion(Int index) */
Version* Depend_endVersion(Depend* self, Int index)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Depend.endVersion not implemented yet"));
}


/* Bool match(Version version) */
Bool Depend_match(Depend* self, Version* version)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Depend.match not implemented yet"));
}


/**********************************************
 *
 * Type-system functions
 *
 **********************************************/


Type* Depend_initType(void)
{
  if (Depend_classType == NULL)
  {
    Type* baseType = Obj_initType();
    VTable* vtable = Depend_initVTable();
    Type* type = Type_new("Depend", baseType, vtable, sizeof(Depend), sizeof(DependVTable));
    Type_registerMethodImplementation(type, "endVersion", Depend_endVersion_0, 0);
    Type_registerMethodImplementation(type, "endVersion", Depend_endVersion, 1);
    Type_registerMethodImplementation(type, "equals", Depend_equals, 1);
    Type_registerMethodImplementation(type, "fromStr", Depend_fromStr_1, 1);
    Type_registerMethodImplementation(type, "fromStr", Depend_fromStr, 2);
    Type_registerMethodImplementation(type, "hash", Depend_hash, 0);
    Type_registerMethodImplementation(type, "isPlus", Depend_isPlus_0, 0);
    Type_registerMethodImplementation(type, "isPlus", Depend_isPlus, 1);
    Type_registerMethodImplementation(type, "isRange", Depend_isRange_0, 0);
    Type_registerMethodImplementation(type, "isRange", Depend_isRange, 1);
    Type_registerMethodImplementation(type, "match", Depend_match, 1);
    Type_registerMethodImplementation(type, "name", Depend_name, 0);
    Type_registerMethodImplementation(type, "size", Depend_size, 0);
    Type_registerMethodImplementation(type, "toStr", Depend_toStr, 0);
    Type_registerMethodImplementation(type, "version", Depend_version_0, 0);
    Type_registerMethodImplementation(type, "version", Depend_version, 1);
    Depend_classType = type;
    Depend_initStatic();
  }
  return Depend_classType;
}


VTable* Depend_initVTable(void)
{
  if (Depend_classVTable == NULL)
  {
    VTable* vtable = memoryAlloc(sizeof(DependVTable));
    memcpy(vtable, Obj_initVTable(), sizeof(FanObjVTable));
    ((FanObjVTable*)vtable)->equals = Depend_equals;
    ((FanObjVTable*)vtable)->hash = Depend_hash;
    ((FanObjVTable*)vtable)->toStr = Depend_toStr;
    Depend_classVTable = vtable;
  }
  return Depend_classVTable;
}


void Depend_initStatic(void)
{
}
